package com.vcc.service.boss.response.trans;

import com.vcc.core.util.DateUtil;
import com.vcc.core.util.StringUtil;
import com.vcc.data.entity.ClearTran;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.math.BigDecimal;

@Data
@Setter
@Getter
public class ClearTranVo implements Serializable {
    private String tranId;
    private Long userId;
    private String account;
    private String cardNumber;
    private String merchantName;
    private String tranDate;
    private String postingDate;
    private BigDecimal billingAmount;
    private String billingCurrency;
    private BigDecimal merchantAmount;
    private String merchantCurrency;
    private String type;
    private String remark;

    public ClearTranVo(){}

    public ClearTranVo(ClearTran clearTran,String account){
        this.tranId = clearTran.getTransactionId();
        this.cardNumber = StringUtil.hideCardNumber(clearTran.getCardNumber());
        this.userId = clearTran.getUserId();
        this.account = StringUtil.hideMobile(account);
        this.merchantName = clearTran.getMerchantName();
        this.tranDate = DateUtil.format("yyyy-MM-dd",clearTran.getTranDate());
        this.postingDate = DateUtil.format("yyyy-MM-dd",clearTran.getPostingDate());
        this.billingAmount = clearTran.getBillingAmount();
        this.billingCurrency = clearTran.getBillingCurrency();
        this.merchantAmount = clearTran.getMerchantAmount();
        this.merchantCurrency = clearTran.getMerchantCurrency();
        this.type = clearTran.getType();
        this.remark = clearTran.getRemark();
    }
}
